package com.sbw.springboot.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.Map;

/**
 * @Author: sangbowei
 * @Description: 模板示例
 * @Date: Created in  20:04 2017\12\13 0013
 **/
@Controller("template.controller")
@RequestMapping(value = "/template")
public class TemplatesController {

    @RequestMapping("/freemarker/hello")
    public String hello(Map<String, Object> model, HttpServletRequest request) {
        model.put("time", new Date());
        model.put("message", "sangbowei");
        model.put("basePath",request.getContextPath());
        return "hello_freemark";
    }
}